<head>
  {{ partial "meta" . }}
  {{- hugo.Generator -}}
  {{- template "_internal/schema.html" . -}}
  {{- template "_internal/opengraph.html" . -}}
  {{- template "_internal/twitter_cards.html" . -}}
  {{- template "_internal/google_news.html" . -}}
  {{- if .Site.Params.enableCDN -}}
    {{- if .Site.Params.highlightjs -}}<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/{{ .Site.Params.highlightjsTheme | default "default" }}.min.css">{{- end -}}
    {{- range .Site.Params.cssFiles -}}
      {{- if eq . "default" -}}
        <link rel="stylesheet" href="{{ "css/normalize.css" | relURL }}">
        <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Raleway:400,800,900|Source+Sans+Pro:400,700">
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css">
        <script src="https://kit.fontawesome.com/be54eb011a.js" crossorigin="anonymous"></script>
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" />
        {{- $mainCSSOptions := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") -}}
        {{- $main := resources.Get "scss/main.scss" | resources.ToCSS $mainCSSOptions | resources.Fingerprint -}}
        <link rel="stylesheet" href="{{ $main.RelPermalink }}" integrity="{{ $main.Data.Integrity }}">
        {{- if eq (i18n "letter_direction") "RTL" -}}
          {{- $rtl := resources.Get "css/rtl.css" | minify -}}
          <link rel="stylesheet" href="{{ $rtl.RelPermalink }}">
        {{- end -}}
        <link rel="stylesheet" href="{{ "css/add-on.css" | relURL }}">
      {{- else }}
        <link rel="stylesheet" href="{{ . | relURL }}">
      {{- end -}}
    {{- end -}}
  {{- else -}}
    {{- range .Site.Params.cssFiles -}}
      {{- if eq . "default" -}}
        {{- $cssSlice := slice -}}
        {{- if $.Site.Params.highlightjs -}}
          {{- $cssSlice = $cssSlice | append (resources.Get (print "css/styles/" ($.Site.Params.highlightjsTheme | default "default") ".css") ) -}}
        {{- end -}}
        {{- $assets := resources.Get "assets.json" | unmarshal -}}
        {{- range $assets.styles -}}
          {{- $cssSlice = $cssSlice | append (resources.Get . ) -}}
        {{- end -}}
        {{- $cssSlice = $cssSlice | append (resources.Get "scss/main.scss" | toCSS) -}}
        {{- $css := $cssSlice | resources.Concat "css/bundle.css" | minify | fingerprint -}}
        <link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
        {{- if eq (i18n "letter_direction") "RTL" -}}
          {{- $rtl := resources.Get "css/rtl.css" | minify -}}
          <link rel="stylesheet" href="{{ $rtl.RelPermalink }}">
        {{- end -}}
        <link rel="stylesheet" href="{{ "css/add-on.css" | relURL }}">
      {{- else }}
        <link rel="stylesheet" href="{{ . | relURL }}">
      {{- end -}}
    {{- end -}}
  {{- end -}}
  {{- .Scratch.Set "Permalink" .Permalink -}}
  {{- .Scratch.Set "Title" .Title -}}
  {{- if .Params.Author -}}
    {{- .Scratch.Set "Author" .Params.Author -}}
  {{- else -}}
    {{- .Scratch.Set "Author" .Author -}}
  {{ end }}
</head>
